package com.aacar.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.aacar.constant.ConsFiled;
import com.aacar.dao.AreaDao;
import com.aacar.dto.AreaDto;
import com.aacar.dto.CityDto;
import com.aacar.dto.PageDto;
import com.aacar.entity.Area;
import com.aacar.entity.City;
import com.aacar.service.AreaSerivce;
import com.aacar.vo.AreaVo;
import com.aacar.vo.CityVo;
import com.aacar.vo.ProvinceVo;
import com.aacar.vo.RoomNameVo;

@Repository("areaSerivce")
public class AreaSerivceImpl implements AreaSerivce{
	
	@Autowired
	private AreaDao areaDao;
	
	//获取省列表
	public List<ProvinceVo> getProvinceList(PageDto page) {
		return this.areaDao.getProvinceList();
	}
	
	//获取市列表
	public List<CityVo> getCityList(CityDto cityDto) {
		City city = new City();
		city.setParentId(cityDto.getProvinceId());
		return this.areaDao.getCityList(city);
	}
	
	//获取所有区列表
	public List<AreaVo> getAreaList(AreaDto areaDto) {
		Area area = new Area();
		area.setParentId(areaDto.getCityId());
		area.setStatus(ConsFiled.Flag_1);
		return this.areaDao.getAreaList(area);
	}

	@Override
	public List<RoomNameVo> getAreaRoomList() {
		return this.areaDao.getRoomList();
	}
	
	
	
	

}
